home *** CD-ROM | disk | FTP | other *** search
- Path: news.softcon.de!usenet
- From: us@SoftcoN.de (Uwe Steffen)
- Newsgroups: comp.databases.oracle,comp.lang.c++
- Subject: Re: Pro*C DB access routines with C++
- Date: 21 Feb 1996 13:09:33 GMT
- Organization: SOFTCON Gesellschaft fuer Systementwicklung mbH, Oberhaching, Muenchen, Deutschland
- Sender: us@hp4kiss.SoftcoN.de (Uwe Steffen)
- Message-ID: <4gf5id$jec@boell.softcon.de>
- References: <4g6vjv$gvv@news1.halcyon.com> <4gcf0c$e02@relay2.uk.mdis.com>
- NNTP-Posting-Host: hp4kiss.softcon.de
- X-Newsreader: knews 0.9.2
- In-Reply-To: <4gcf0c$e02@relay2.uk.mdis.com>
- To: danubius@coho.halcyon.com
-
- In article <4gcf0c$e02@relay2.uk.mdis.com>,
- 100610.52@compuserve.com (Balakrishna Avula) writes:
- >danubius@coho.halcyon.com () wrote:
- >
- >>I've been trying to find a book covering this subject to no avail so
- >>far.
- >
- >>I have a C++ project that will need a bunch of Pro*C ORACLE DB access
- >>routines. I'd like to wrap these routines in C++ classes, but being
- >>fairly new at both, I could use some help from published books on this
- >>subject, or example source code.
-
- Hi,
- it's a little bit tricky to start with, however solvable.
- 1) You have to use PRO*C 1.6 instead of PRO*C 2.*, because
- PRO*C 1.6 does not scan the entire file, only statements that
- start with 'EXEC SQL'.
- 2) our .ec-files are called '*.ec', so we use the following rule to create
- object-files:
- .ec.o:
- $(ESQL) INAME=$*.ec ONAME=$*.c $(ESQLFLAGS)
- sed -f ../changec_C.sed $*.c >$*.C
- $(RM) $*.EC
- $(RM) $*.c
- $(CC) -c $(FLAGS) $*.C
- The sed-scripts does some postprocessing to correct
- some incompatibilitys.
- changec_C.sed:
- 1,$s/char filnam\[.*\]/char filnam\[31\]/
- /extern sqlcex(*/d
- /extern sqlora(*/d
- /extern sqlbuf(*/d
- /extern sqlcte(*/d
- /extern sqlcx2(*/d
- /extern sqliem(*/d
- You will have to put extern "C" { ... } -wrappers around function-
- prototypes in oracle-headerfiles.
-
- Good luck
- Uwe Steffen
-
-
-
-